package com.whw.fy.mapper;

import com.whw.fy.entity.PurchaseCourseRecords;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

@Mapper
public interface PurchaseCourseRecordsMapper {
    int deleteByPrimaryKey(Integer purchaseId);

    int insert(PurchaseCourseRecords record);

    int insertSelective(PurchaseCourseRecords record);

    PurchaseCourseRecords selectByPrimaryKey(Integer purchaseId);

    int updateByPrimaryKeySelective(PurchaseCourseRecords record);

    int updateByPrimaryKey(PurchaseCourseRecords record);

    int updateBatchSelective(List<PurchaseCourseRecords> list);

    int batchInsert(@Param("list") List<PurchaseCourseRecords> list);

    List<PurchaseCourseRecords> selectAll();

    List<PurchaseCourseRecords> selectByStudentId(@Param("studentId") Integer studentId);

    List<PurchaseCourseRecords> selectByStudentIdAndClassStatus(@Param("studentId") Integer studentId, @Param("classStatus") Integer classStatus);

    PurchaseCourseRecords selectByStudentIdAndLessonId(@Param("studentId") Integer studentId, @Param("lessonId") Integer lessonId);

    PurchaseCourseRecords selectByPayId(@Param("payId")String payId);


    int updatePurchaseClazzIdByStudentIdAndLessonId(@Param("updatedPurchaseClazzId")Integer updatedPurchaseClazzId,@Param("studentId")Integer studentId,@Param("lessonId")Integer lessonId);





    int updateClassTimesAndRemainingTimesByPurchaseId(@Param("updatedClassTimes") Integer updatedClassTimes, @Param("updatedRemainingTimes") Integer updatedRemainingTimes, @Param("purchaseId") Integer purchaseId);
}